<template>
  <div class="customeraddchild">
    <div class="top111">
      <img @click="fanhui" src="../assets/总图标包含整个系统的/fanhui.png" />
      <span>选择客户</span>
      <img
        class="aaaa"
        src="../assets/总图标包含整个系统的/fanhuishouye.png"
        @click="fanhuish"
      />
    </div>
    <van-search
      v-model="value"
      shape="round"
      background="#ffffff"
      placeholder="关键字查询"
      :show-action="right"
      action-text="搜索"
    />
    <div
      class="box"
      v-for="(itme, index) in arr"
      :key="index"
      @click="jump(itme.id, itme.custName)"
    >
      <div class="left">
        <img src="../assets/总图标包含整个系统的/头像.png" />
        <span>{{ itme.custName }}</span>
      </div>
      <img class="imgte" src="../assets/总图标包含整个系统的/More.png" />
    </div>
  </div>
</template>
 
<script>
import { GetChooseApiList } from "../request/aip";
export default {
  data() {
    return {
      value: "",
      right: true,
      arr: [],
    };
  },
  methods: {
    fanhui() {
      this.$router.go(-1);
    },
    fanhuish() {
      this.$router.push("/index");
    },
    jump(id, custName) {
      // console.log(id, custName);

      this.$router.push({
        name: "CustomerAdd",
        params: { id, custName },
      });
    },
  },
  created() {
    GetChooseApiList({
      current: 1,
      size: 8,
    }).then((res) => {
      // console.log(res);
      this.arr = res.data.records;
    });
  },
};
</script>
 
<style lang = "less" scoped>
.customeraddchild {
  width: 100vw;
  height: 100vh;
  background-color: #f5f5f5;
}
.top111 {
  background-color: #023293;
  display: flex;
  justify-content: space-between;
  color: #fff;
  align-items: center;
  padding: 10px;
  img {
    width: 10px;
  }
  .aaaa {
    width: 20px;
  }
}
.box {
  display: flex;
  justify-content: space-between;
  background-color: #fff;
  align-items: center;
  padding: 10px;
  border-top: 1px solid #f5f5f5;
  .left {
    display: flex;
    align-items: center;
    img {
      width: 40px;
      margin-right: 10px;
    }
  }
  .imgte {
    width: 5px;
    height: 15px;
  }
}
.van-search {
  margin-bottom: 10px;
}
</style>